package chapter4;

public class IfElse {

    private static int result = 0;

    private static void test(int guess, int target) {
        if (guess > target)
            result = 1;
        else if (guess < target)
            result = -1;
        else
            result = 0;
    }

    void sayHello(){
        System.out.println("hello");
    }

    protected void sayHello1(){
        System.out.println("hello");
    }

    public static void main(String[] args) {
        switch ("123") {
            case "123":
                System.out.println("123");
                break;
            case "123456":
                System.out.println("123456");
                break;
        }

        test(10, 5);
        System.out.println(result);
        test(5, 10);
        System.out.println(result);
        test(5, 5);
        System.out.println(result);

        outer1:
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                if (i == 3 && j == 3)
                    break outer1;
                System.out.println(i + " " + j);
            }
        }

        outer2:
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                if (i == 3 && j == 3)
                    continue outer2;
                System.out.println(i + " " + j);
            }
        }
    }
}
